package com.qcby.shujia.demo.controller;

import com.qcby.shujia.demo.entity.Tright;
import com.qcby.shujia.demo.service.TrightService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @className: TrightController
 * @description: TODO 类描述
 * @author: whz
 * @date: 2021/9/20
 **/
@RestController
@RequestMapping("/right")
public class TrightController {
    @Autowired
    private TrightService trightService;
    @RequestMapping("/insert")
    public int insert(Tright tright) {
        int insert = trightService.insert(tright);
        return insert;
    }
    @RequestMapping("/delete")
    public int delete(Integer id) {
        int delete = trightService.delete(id);
        return delete;
    }
    @RequestMapping("/deletedisp")
    public int deletedisp(int[] ids) {
        int deletedisp = trightService.deletedisp(ids);
        return deletedisp;
    }
    @RequestMapping("/selectAll")
    public List<Tright> selectAll() {
        List<Tright> trights = trightService.selectAll();
        return trights;
    }
    @RequestMapping("/update")
    public int update(Tright tright) {
        int update = trightService.update(tright);
        return update;
    }


}
